﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SDMX_Common = SDMX_ML.Framework.Common;

namespace SDMX_ML.Framework.Metadata
{
    /// <summary>
    /// AttributeValuesType.
    /// </summary>
    public class AttributesValueSetType
    {
        //Elements.
        private SDMX_Common.IDType _targetRef;
        private List<ReportedAttributeType> _reportedAttribute;
        private TargetValuesType _targetValues;

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="targetRef">TargetRef.</param>
        /// <param name="targetValues">TargetValues.</param>
        /// <param name="reportedAttribute">ReportedAttribute.</param>
        public AttributesValueSetType(SDMX_Common.IDType targetRef, TargetValuesType targetValues, ReportedAttributeType reportedAttribute)
        {
            if (targetRef != null & targetValues != null & reportedAttribute != null)
            {
                _reportedAttribute = new List<ReportedAttributeType>();
                _reportedAttribute.Add(reportedAttribute);
                _targetRef = targetRef;
                _targetValues = targetValues;
            }
            else
            {
                throw new Exception("Values TargetRef, TargetValues and ReportedAttribute are required fields in AttributesaluesType.");
            }
        }

        /// <summary>
        /// TargetRef.
        /// </summary>
        public SDMX_Common.IDType TargetRef
        {
            get { return _targetRef; }
            set { _targetRef = value; }
        }

        /// <summary>
        /// TargetValues.
        /// </summary>
        public TargetValuesType TargetValues
        {
            get { return _targetValues; }
            set { _targetValues = value; }
        }

        /// <summary>
        /// ReportedAttribute
        /// </summary>
        public List<ReportedAttributeType> ReportedAttribute
        {
            get { return _reportedAttribute; }
            set { _reportedAttribute = value; }
        }
    }
}
